#include "game.h"
#include "display.c"
#include "btns.c"
#include "uart.c"

void main()
{
    unsigned char btn_code;
    uart_init();
    display_init();
    display_speed_selection();
    while (1)
    {
        btn_code = btn_scan();
        switch (btn_code)
        {
        case BTN_CODE_LEFT:
            if (game_setting.speed == 0)
            {
                game_setting.speed = 9;
            }
            else
            {
                game_setting.speed--;
            }

            display_speed_in_selection();
            break;
        case BTN_CODE_RIGHT:
            if (game_setting.speed == 9)
            {
                game_setting.speed = 0;
            }
            else
            {
                game_setting.speed++;
            }
            display_speed_in_selection();
            break;
        default:
            break;
        }
    }
}